import request from './request'

// 获取当前用户信息
export const getUserInfo = () => {
  return request.get('/users/me')
}

// 更新用户信息
export const updateUserInfo = (data) => {
  return request.patch('/users/me', data)
}

// 上传头像
export const uploadAvatar = (formData) => {
  return request.post('/users/avatar', formData, {
    headers: { 'Content-Type': 'multipart/form-data' }
  })
}

